﻿CREATE PROCEDURE [dbo].[sproc_DUONG_KHAO_SAT_Get4Export]
AS
	SELECT DISTINCT
		dks.QUAN,dks.DUONG,ts.SEQUENCE
	FROM
		[DUONG_KHAO_SAT] dks
		INNER JOIN HO_SO_THAM_DINH hstd ON hstd.MA_DKS = dks.MA_DKS AND hstd.ACTIVE_FLAG = 'Y'
		inner join THAM_SO ts on ts.MA_THAM_SO=dks.QUAN and ts.LOAI_THAM_SO='LOAI_QUAN' 
	WHERE 
		dks.ACTIVE_FLAG = 'Y'
	Order by ts.SEQUENCE